<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ page import="com.homework.service.HomeWorkService"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.homework.entity.Homewokmaster"%>
<%@ page import="com.homework.entity.Homeworkdetail"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作业管理系统</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Jekyll v3.7.0">

<title>作业管理系统</title>

<!-- Bootstrap core CSS -->

<style class="anchorjs"></style><link href="./Navbar · Bootstrap_files/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">


<!-- Documentation extras -->

<link href="./Navbar · Bootstrap_files/docsearch.min.css" rel="stylesheet">

<link href="./Navbar · Bootstrap_files/docs.min.css" rel="stylesheet">

<meta name="msapplication-config" content="/assets/img/favicons/browserconfig.xml">
<meta name="theme-color" content="#563d7c">


<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@getbootstrap">
<meta name="twitter:creator" content="@getbootstrap">
<meta name="twitter:title" content="Navbar">
<meta name="twitter:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">

<!-- Facebook -->
<meta property="og:title" content="Navbar">
<meta property="og:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta property="og:type" content="website">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
 <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<%
  String username=(String)session.getAttribute("uname");
%>
    <a id="skippy" class="sr-only sr-only-focusable" href="https://v4.bootcss.com/docs/4.0/components/navbar/#content">
      <div class="container">
        <span class="skiplink-text">Skip to main content</span>
      </div>
    </a>

    <header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
  <a class="navbar-brand mr-0 mr-md-2" href="https://v4.bootcss.com/" aria-label="Bootstrap"><svg class="d-block" width="36" height="36" viewBox="0 0 612 612" xmlns="http://www.w3.org/2000/svg" focusable="false"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"></path><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"></path></svg>
</a>

  <div class="navbar-nav-scroll">
    <ul class="navbar-nav bd-navbar-nav flex-row">
      <li class="nav-item">
        <a class="nav-link " href="https://v4.bootcss.com/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Bootstrap&#39;);">首页</a>
      </li>
      <li class="nav-item">
        <a class="nav-link active" href="https://v4.bootcss.com/docs/4.0/getting-started/introduction/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Docs&#39;);">积分排行榜</a>
      </li>
      <li class="nav-item">
        <a class="nav-link " href="https://v4.bootcss.com/docs/4.0/examples/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Examples&#39;);">实例</a>
      </li>
      <!-- <li class="nav-item">
        <a class="nav-link" href="https://themes.getbootstrap.com" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');" target="_blank" rel="noopener">Themes</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="https://jobs.getbootstrap.com" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Jobs');" target="_blank" rel="noopener">Jobs</a>
      </li> -->
      <li class="nav-item">
        <a class="nav-link" href="http://www.youzhan.org/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Expo&#39;);" target="_blank" rel="noopener">优站精选</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="https://blog.getbootstrap.com/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Blog&#39;);" target="_blank" rel="noopener">Blog</a>
      </li>
    </ul>
  </div>

  <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">

    <li class="nav-item">
    <p class="navbar-brand">欢迎 <%=username %></p>
    </li>
  </ul>

  <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="login.html">退出</a>
</header>


    <div class="container-fluid">
      <div class="row flex-xl-nowrap">
      
       <!-- 左边导航开始 -->
        <jsp:include page="leftside.jsp"></jsp:include>
 		<!-- 左边导航结束 -->
        

        <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
		          <h1 class="bd-title" id="content">查看作业</h1>
		          
		          <form class="form-inline" action="HomeWorkSelectServlet">
					  <label >日期:</label>
					  <input type="date" class="form-control" name="seldate">
					  
					  &nbsp&nbsp<label for="pwd">作业类型:</label>
					  <select class="form-control"  name="type">
					  		<option value='竞赛'>竞赛</option>
					  		<option value='结对'>结对</option>
					  </select>
					  
					  &nbsp&nbsp<button type="submit" class="btn btn-primary">查询</button>
				</form>
<br>
<br>

		         <div class="table-responsive">
<table class="table table-striped table-bordered">
    <thead>
      <tr>
        <th>#</th>
        <th>作业标题</th>
        <th>作业开放日期</th>
        <th>类型</th>
        <th>提交情况</th>
      
      </tr>
    </thead>
    <tbody>
    <%
    ArrayList<Homewokmaster> hms=(ArrayList<Homewokmaster>)session.getAttribute("homelist");
  	if(hms==null){
  		 hms=new ArrayList();
  	}
    for(int i=0;i<hms.size();i++){
    	Homewokmaster hm=hms.get(i);
   
    
    %>
      <tr>
        <td><%=hm.getId() %></td>
        <td><%=hm.getTitle() %></td>
        <td><%=hm.getOpen_date() %></td>
        <td><%=hm.getType() %></td>
        <td>
        <button  type="button" class="btn btn-primary" name="opendetailbtn" id="<%=hm.getId() %>" >
  		 	查看
 	 	</button>
        
        </td>
      </tr>
      
      <%  }%>
    </tbody>
</table>
</div>
		</main>
        
        
        
      </div>
    </div>


<script src="./Navbar · Bootstrap_files/popper.min.js.下载" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="./Navbar · Bootstrap_files/bootstrap.min.js.下载" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script src="./Navbar · Bootstrap_files/docsearch.min.js.下载"></script><script src="./Navbar · Bootstrap_files/docs.min.js.下载"></script>
  


 <!-- 模态框 -->
  <div class="modal fade" id="modaldetail">
    <div class="modal-dialog">
      <div class="modal-content">
   
        <!-- 模态框头部 -->
        <div class="modal-header">
          <h4 class="modal-title">模态框头部</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
   
        <!-- 模态框主体 -->
        <div class="modal-body">
			          <div class="table-responsive">
								<table class="table table-striped table-bordered">
								    <thead>
								      <tr>
								        <th>学生名字</th>
								        <th>提交情况</th>
								       
								      
								      </tr>
								    </thead>
								    <tbody id="dtbodybtn">
								    
								    
								    </tbody>
								</table>
					</div>
        </div>
   
        <!-- 模态框底部 -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
        </div>
   
      </div>
    </div>
  </div>
  <!-- 模态框  end-->
 
  
  
  <script type="text/javascript">
  
  $(document).ready(function(){
	  // 在这里写你的代码...
	  

	  $("#nava3").css("color","red");

	  $("button[name='opendetailbtn']").click(function(){
		  //alert("你点我了"+this.id);
		  var rid=this.id;
		 
		  $.getJSON("HomeWorkCheckServlet", { hid: rid }, function(json){
			   console.log(json);
			   $("#dtbodybtn").empty();
			   for(var i=0;i<json.length;i++){
				   $("#dtbodybtn").append(
					"<tr>"  
					+"<td>"+ json[i].userName  
					+"</td>"
					+"<td>"+ json[i].isSubmit  
					+"</td></tr>" 
				   );
			   }
			   $('#modaldetail').modal("show");
			});
		  
		  
		 
		  
		
		  
		 
		  
	  });
	  
	});
  
  
  
  </script>
</body>
</html>